class Solution
{
public:
    int encryptionCalculate(int dataA, int dataB)
    {
        if (dataB == 0)
            return dataA;

        int sum = dataA ^ dataB;
        int carry = (unsigned int)(dataA & dataB) << 1;

        dataA = sum;
        dataB = carry;

        return encryptionCalculate(dataA, dataB);
    }
};